/*
 * AttackHashMap.java
 *
 * Created on September 8, 2007, 11:30 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.lct.eq2.data;

import java.util.Comparator;
import java.util.HashMap;

/**
 *
 * @author Me
 */
public class AttackHashMap extends HashMap implements Comparator {
    private String attackString;
    private int direction;
    private int attackClass;
    private int attackType;
    
    /** Creates a new instance of AttackHashMap */
    public AttackHashMap() {
    }
    
    public void setMainAttackString(String attackString) {
        this.attackString = attackString;
    }
    
    public void setAttackClassInt(int attackClass) {
        this.attackClass = attackClass;
    }

    public void setAttackTypeInt(int attackType) {
        this.attackType = attackType;
    }

    public int getAttackTypeInt() {
        return this.attackType;
    }

    public int getAttackClassInt() {
        return this.attackClass;
    }
    
    public void setDirection(int direction) {
        this.direction = direction;
    }
    
    public int getDirection() {
        return this.direction;
    }
    
    public String toString() {
        return this.attackString;
    }
    
    public boolean isHeal() {
        boolean rval = false;
        if (this.attackClass == Attack.ATTACK_TYPE_NON_MELEE_HEALING) {
            rval = true;
        }
        return rval;
    }
    
    public boolean isMelee() {
        boolean rval = false;
        if (this.attackClass == Attack.ATTACK_TYPE_MELEE) {
            rval = true;
        }
        return rval;
    }
    
    public boolean isNonMelee() {
        boolean rval = false;
        if (this.attackClass == Attack.ATTACK_TYPE_NON_MELEE) {
            rval = true;
        }
        return rval;
    }

    public int compare(Object o1, Object o2) {
        AttackHashMap m1 = (AttackHashMap)o1;
        AttackHashMap m2 = (AttackHashMap)o2;
        
        int rval = 0;
        if (m1.toString().compareTo(m2.toString()) > 0) {
            rval = 1;
        } else if (m1.toString().compareTo(m2.toString()) < 0) {
            rval = -1;
        } else {
            rval = 0;
        }
        return rval;
    }
}
